﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Forms;
using System.Collections.ObjectModel;
using System.ComponentModel;
using JHoelsch.DataClases.DataBase;

namespace JHoelsch.Gui.View
{
    public partial class MainWindow : INotifyPropertyChanged
    {
        public ObservableCollection<Car> CarList
        {
            get
            {
                foreach (Car car in dataHolderInstance.AutoDatenSaetze)
                {
                    if (car.Color == null)
                    {
                        car.Color = getColor();
                    }
                }
                return dataHolderInstance.AutoDatenSaetze;
            }
        }
        public event PropertyChangedEventHandler PropertyChanged;
        private Car activeCar = new Car();
        public Car ActiveCar
        {
            get { return activeCar; }
            set
            {

                activeCar = value;
                this.Title = "Spritverbauch - " + ActiveCar.ToString();
                overViewGrid.Visibility = System.Windows.Visibility.Visible;
                NotifyPropertyChanged("ActiveCar");
            }
        }
        private List<Brush> m_colors = new List<Brush>();

        private DataHolder dataHolderInstance = DataHolder.Instance;
        private OpenFileDialog openFileDialog = new OpenFileDialog();
        private SaveFileDialog saveFileDialog = new SaveFileDialog();           
    }
}
